# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Andre Klitzing <aklitzing () online () de>

pkgname=libytnef
pkgver=1.9.2
pkgrel=2
pkgdesc="Yerase's TNEF Stream Reader library (decode winmail.dat)"
url="https://github.com/Yeraze/ytnef"
license=('GPL')
arch=('i686' 'x86_64')
depends=('glibc')
makedepends=('perl')
optdepends=('perl: ytnefprocess.pl script')
source=(https://github.com/Yeraze/ytnef/archive/v${pkgver}.tar.gz
        CVE-2017-9058.patch)
sha256sums=('48f7d7272ba74b267d3f98a1b14c81fef54cfb53460346d7c36a9604df1f95ad'
            'd2fcf8e9c3253f8a56006b2e622b527a37c4352487cdfc86719eb3fb719318ed')

prepare() {
  cd ytnef-${pkgver}
  patch -Np1 -i ../CVE-2017-9058.patch
}

build() {
  cd ytnef-${pkgver}
  ./autogen.sh
  autoreconf -fi
  ./configure --prefix=/usr --disable-static
  make
}

package() {
  cd ytnef-${pkgver}
  make DESTDIR="$pkgdir" install
}
